/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.report.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Maps;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

import javax.xml.bind.annotation.XmlTransient;
import java.util.Date;
import java.util.Map;

/**
 * 周报Entity
 * @author 卢经纬
 * @version 2018-06-27
 */
public class WeekReport extends DataEntity<WeekReport> {
	
	private static final long serialVersionUID = 1L;
	private String content;		// 周报内容
	private Date startTime;		// 开始时间
	private Date endTime;		// 结束时间
	private String type;		// 0：暂存1：提交
	/**
	 * 自定义SQL（SQL标识，SQL内容）
	 */
	protected Map<String, String> sqlMap;
	
	public WeekReport() {
		super();
	}

	public WeekReport(String id){
		super(id);
	}

	@ExcelField(title="周报内容", align=2, sort=1)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@ExcelField(title="开始时间", align=2, sort=2)
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	@ExcelField(title="结束时间", align=2, sort=3)
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@ExcelField(title="状态（0：暂存1：提交）", align=2, sort=3)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@JsonIgnore
	@XmlTransient
	public Map<String, String> getSqlMap() {
		if (sqlMap == null){
			sqlMap = Maps.newHashMap();
		}
		return sqlMap;
	}

	public void setSqlMap(Map<String, String> sqlMap) {
		this.sqlMap = sqlMap;
	}
}